package com.product.api;


import com.product.api.model.ProductInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "product-server" ,path = "/product")
public interface ProductApi {

    @RequestMapping("/{productId}")
    ProductInfo getProductInfo(@PathVariable("productId") Integer productId) ;

    @RequestMapping("/p1")
     String p1(@RequestParam("id") Integer id , @RequestParam("name") String name);


    @RequestMapping("/p2")
     String p2(@SpringQueryMap ProductInfo productInfo);

    // 传递json
    @RequestMapping("/p3")
    public String p3(@RequestBody ProductInfo productInfo) ;


}
